package com.huzz.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckRole;
import com.huzz.feign.FeignService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Name 名称
 * @Description 描述
 * @Author 童年的纸飞机
 * @Since 2023-08-2023/8/1 16:20
 */
@Api(tags = "服务1的测试模块 API")
@RestController
@RequestMapping("/api/app1")
public class App1Controller {

    @Qualifier("com.huzz.feign.FeignService")
    @Autowired
    private FeignService feignService;

    @ApiOperation(value = "服务1返回的消息")
    @SaCheckRole("admin")
    @GetMapping("/getMessageInfo")
    public String getMessageInfo() {
        return "服务1返回的消息";
    }

    @ApiOperation(value = "服务1调用服务2的消息")
    @GetMapping("/getMessageInfoByServer-02")
    public String getMessageInfoByServer_02() {
        return "服务1调用服务2的消息: "+ feignService.getMessageInfo();
    }

}
